home *** CD-ROM | disk | FTP | other *** search
/ Language/OS - Multiplatform Resource Library / LANGUAGE OS.iso / lisp / kcl / akcl / akcl1615.lha / h / bsd.h < prev    next >
Text File  |  1992-04-07  |  2KB  |  98 lines

  1. #define BSD
  2. #define UNIX
  3. #define AV
  4. #define SFASL
  5. #define HAVE_AOUT <a.out.h>
  6.  
  7. #define MAXPAGE 16384
  8. #define VSSIZE 8152
  9.   
  10.  
  11. #define MEM_SAVE_LOCALS    \
  12.   struct exec header;\
  13.   int stsize
  14.  
  15. #define READ_HEADER     fread(&header, sizeof(header), 1, original); \
  16.     data_begin=DATA_BEGIN; \
  17.     data_end = core_end; \
  18.     original_data = header.a_data; \
  19.     header.a_data = data_end - data_begin; \
  20.     header.a_bss = 0; \
  21.     fwrite(&header, sizeof(header), 1, save);
  22.  
  23. #define FILECPY_HEADER \
  24.     filecpy(save, original, header.a_text - sizeof(header));
  25.  
  26. #define  COPY_TO_SAVE \
  27.   filecpy(save, original, header.a_syms+header.a_trsize+header.a_drsize); \
  28.   fread(&stsize, sizeof(stsize), 1, original); \
  29.   fwrite(&stsize, sizeof(stsize), 1, save); \
  30. filecpy(save, original, stsize - sizeof(stsize))
  31.  
  32.  
  33. #define NUMBER_OPEN_FILES getdtablesize() 
  34.  
  35. #define SET_REAL_MAXPAGE real_maxpage = MAXPAGE ;\
  36.          getrlimit(RLIMIT_DATA, &data_rlimit); \
  37.     real_maxpage = ((unsigned int)&etext + data_rlimit.rlim_cur)/PAGESIZE; \
  38.     if (real_maxpage > MAXPAGE) \
  39.         real_maxpage = MAXPAGE
  40.      
  41. #define ROUND_UP_SBRK(x)  \
  42.        do {int i; \
  43.          if (i = ((int)x & (PAGESIZE - 1))) \
  44.            x=sbrk(PAGESIZE - i); } while(0);
  45.  
  46. #define FIX_RANDOM_SBRK \
  47. do {char *x=sbrk(0); \
  48.   if (core_end != x) \
  49.    { ROUND_UP_SBRK(x); x=sbrk(0);\
  50.      while (core_end < x) \
  51.        { type_map[page(core_end)]= t_other; \
  52.      core_end = core_end + PAGESIZE;} \
  53.      if (core_end !=x) error("Someone allocated my memory");}} while (0)
  54.  
  55.      
  56. #define INIT_ALLOC \
  57.          heap_end = sbrk(0); ROUND_UP_SBRK(heap_end);\
  58.     heap_end = core_end = sbrk(0);
  59.  
  60. #define IF_ALLOCATE_ERR \
  61.         FIX_RANDOM_SBRK; \
  62.     if (core_end != sbrk(PAGESIZE*(n - m)))
  63.  
  64. #define SYM_EXTERNAL_P(sym) ((sym)->n_type & N_EXT)
  65.      
  66. #define cs_check(x) 
  67.  
  68.  
  69. #define LD_COMMAND(command,main,start,input,ldarg,output) \
  70.   sprintf(command, "ld -d -N -x -A %s -T %x %s %s -o %s", \
  71.             main,start,input,ldarg,output)
  72.  
  73. #define SYM_UNDEF_P(sym) ((N_SECTION(sym)) == N_UNDEF)
  74. #define NUM_AUX(sym) 0
  75.  
  76.        /* the section like N_ABS,N_TEXT,.. */
  77.  
  78.  
  79.   /* We have socket utilities, and can fork off a process
  80.    and get a stream connection with it */
  81. #define RUN_PROCESS
  82.  
  83. #define HAVE_XDR
  84.  
  85. #define WANT_VALLOC  
  86.  
  87.   /* if there is no input there return false */
  88. #define LISTEN_FOR_INPUT(fp) \
  89.   if((fp)->_cnt <=0 && (c=0,ioctl((fp)->_file, FIONREAD, &c),c<=0)) \
  90.      return 0
  91.  
  92.  /* have sys/ioctl.h */
  93. #define HAVE_IOCTL
  94.   
  95.  
  96. #define HAVE_SIGVEC
  97.   
  98.